<?php

declare(strict_types=1);
/**
 * This file is part of MoChat.
 * @link     https://mo.chat
 * @document https://mochat.wiki
 * @contact  group@mo.chat
 * @license  https://github.com/mochat-cloud/mochat/blob/master/LICENSE
 */

namespace MoChat\ClientNew\Model;

use Hyperf\Database\Model\Concerns\CamelCase;
use Hyperf\Database\Model\SoftDeletes;
use Hyperf\DbConnection\Db;
use MoChat\Framework\Model\AbstractModel;
use Qbhy\HyperfAuth\Authenticatable;

class UserBtob extends AbstractModel
{
    use CamelCase;

    /**
     * The table associated with the model.
     *
     * @var string
     */
    protected $table = 'user';
    protected $connection='b2b';

//    public function salesman(){
//        return $this->hasOne()
//    }
    public function salesman(){
        return $this->belongsToMany(Salesman::class,'b2b.assign_salesman','USER_ID','SALESMAN_ID','ID');
    }
}
